package com.ctgu.dao;

import com.ctgu.entity.Record;
import com.ctgu.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface UserDao {
    @Select("select * from user where username=#{username} and psw=#{psw}")
    User logincheck(User user);//登录
    @Insert("insert into user(username,psw,phone,question,answer) values(#{username},#{psw},#{phone},#{question},#{answer})")
    void register(User user);//注册
    @Select("select * from user where username= #{username}")
    User findUserInfoByName(String username);
    @Update("update user set username=#{username},psw=#{psw},phone=#{phone},question=#{question},answer=#{answer} where user_id=#{user_id}")
    void resetpassword(User user);//修改密码

    List<Record>getRecord(Record record);
}
